﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System;
using Sebastof.Services.Interfaces;

#endregion

namespace InterLinq.Test {
	/// <summary>
	/// Description of the class
	/// </summary>
	[Serializable]
	public class InterLinqProduct : SebastofApplicationObject, IProduct {
		#region Public Properties

		/// <summary>
		/// Returns the name of the product
		/// </summary>
		public virtual string Name {
			get { return GetValue<String>("Name"); }
			set { SetValue("Name", value); }
		}

		/// <summary>
		/// Returns the price of the product in sfr
		/// </summary>
		public virtual decimal Price {
			get { return GetValue<decimal>("Price"); }
			private set { SetValue("Price", value); }
		}

		#endregion

		#region Public Methods

		/// <summary>
		/// Ctr
		/// </summary>
		/// <param name="name">name of the product</param>
		/// <param name="price">price of the product [sfr]</param>
		public InterLinqProduct(string name, decimal price) {
			Name = name;
			Price = price;
			Id = Guid.NewGuid().ToString();
		}

		/// <summary>
		/// Ctr
		/// </summary>
		public InterLinqProduct() {
			Id = Guid.NewGuid().ToString();
		}

		#endregion

		#region IProduct Members

		Guid IProduct.Id {
			get { return new Guid(base.Id); }
			set { base.Id = value.ToString(); }
		}

		#endregion
	}
}